package com.itheima.pay;

public class GoldenCar extends Card{
    public GoldenCar() {}
    public GoldenCar(String number, String name, String phone, double balance) {
        super(number, name, phone, balance);
    }

    @Override
    public void pay(double money) {
        setBalance(getBalance()-money*0.8);
        System.out.println("金卡支付成功,享受8折优惠");
        System.out.println("打折后需要支付的金额为"+money*0.8);
        System.out.println("支付后的余额为"+getBalance());
        if(money*0.8>=200)
        {
            System.out.println("打印洗车票");
        }
        else
        {
            System.out.println("消费不足200 无法打印洗车票");
        }
    }
}
